<template>
  <noAuth
    @btn-event="toSet"
    :isButtonShow="true"
    buttonText="去设置"
    :tipsText="`您已关闭超级二维码功能，${systemSettingAuth ? '请开启超级二维码' : '请联系管理员开启'}`"
    >
  </noAuth>
</template>

<script>
import noAuth from '@src/component/auth/noAuth'
import { openAccurateTab } from '@src/util/platform'
import { PageRoutesTypeEnum } from 'pub-bbx-global/pageType/dist/enum/PageRoutesEnum'
export default {
  name: 'qrcode-auth',
  inject: ['initData'],
  components: {
    noAuth
  },
  computed: {
    systemSettingAuth() {
      return this.initData?.auths?.SYSTEM_SEETING
    }
  },
  methods: {
    toSet() {
      let fromId = window.frameElement.getAttribute('id');

      // this.$platform.openTab({
      //   id: 'superqrcodeSet',
      //   title: '产品管理设置',
      //   close: true,
      //   url: '/setting/productV2/catalog/setting?type=qrcodeSet',
      //   fromId
      // })
      openAccurateTab({
        type: PageRoutesTypeEnum.PageProductQrcodeSet,
        // titleKey: '产品管理设置',
        params: 'type=qrcodeSet',
        fromId
      })
    }
  },
}
</script>